package com.dz.risk.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dz.risk.pojo.domain.RiskFactorValueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 风险因子值
 * 
 * @author baohan
 * @email 
 * @date 2021-06-18 13:26:43
 */
@Mapper
@Repository
public interface RiskFactorValueDao extends BaseMapper<RiskFactorValueEntity> {

    List<RiskFactorValueEntity> queryFactorAndValue(@Param("initDate")String initDate);

    /**
     * 拼接sql查询
     * @param ids
     * @param tableName
     * @param fields
     * @return
     */
    List<Map<String,Object>> getSql(@Param("ids") String ids, @Param("tableName") String tableName, @Param("fields") String fields);

    List<Map<String, Object>> getSqlAll(@Param("tableName") String tableName,
                                            @Param("pageNum") Integer pageNum,
                                            @Param("pageSize") Integer pageSize
                                       );
    int getListCount(@Param("tableName") String tableName);
    /**
     * 拼接sql update
     * @param ids
     * @param tableName
     * @param fields
     * @param value
     */
    void updateByIdTal(@Param("ids") String ids, @Param("tableName") String tableName,
                       @Param("fields") String fields,@Param("value") String value);

    void updateByIdTalAll(@Param("tableName") String tableName);


    void updateThreadFlag(@Param("initDate")String initDate);
}
